import VueRouter from "vue-router";

// 導入對應的路由組件
import HomeContainer from "./components/tabbar/HomeContainer.vue";
import MemberContainer from "./components/tabbar/MemberContainer.vue";
import SearchContainer from "./components/tabbar/SearchContainer.vue";
import ShopcarContainer from "./components/tabbar/ShopcarContainer.vue";

// 导入新闻列表页面
import newsList from "./components/news/newslist.vue";
// 导入新闻详情页面
import newsInfo from "./components/news/newsinfo.vue";

// 导入图片的组件
import photolist from "./components/photos/photolist.vue";
import photoinfo from "./components/photos/photoinfo.vue";
import goodslist from "./components/goods/goodslist.vue";
// 导入商品详情
import goodsInfo from "./components/goods/goodsinfo.vue";
// 創建路由對象
import goodsdesc from "./components/goods/GoodsDesc.vue";
import goodscomment from "./components/goods/GoodsComment.vue";
var router = new VueRouter({
  routes: [
    { path: "/", redirect: "/home" },
    { path: "/home", component: HomeContainer },
    { path: "/menber", component: MemberContainer },
    { path: "/shopcar", component: SearchContainer },
    { path: "/search", component: ShopcarContainer },
    { path: "/home/newslist", component: newsList },
    { path: "/home/newsinfo/:id", component: newsInfo },
    { path: "/home/photolist/", component: photolist },
    { path: "/home/photoinfo/:id", component: photoinfo },
    { path: "/home/goodslist", component: goodslist },
    { path: "/home/goodsinfo/:id", component: goodsInfo, name: "goodsinfo" },
    { path: "/home/goodsdesc/:id", component: goodsdesc, name: "goodsdesc" },
    {
      path: "/home/goodscomment/:id",
      component: goodsdesc,
      name: "goodscomment"
    }
  ],
  linkActiveClass: "mui-active"
});

export default router;
